//
//  JKWebViewController.swift
//  新浪微博
//
//  Created by Jack.Lin on 16/7/11.
//  Copyright © 2016年 Jack.Lin. All rights reserved.
//

import UIKit

class JKWebViewController: JKBaseViewController {

    
    private lazy var webView = UIWebView(frame: UIScreen.main().bounds)
    
    var urlString: String? {
    
        didSet {
           
            guard let urlString = urlString,
                url = URL(string: urlString)
                else {
                return
            }
            webView.loadRequest(URLRequest(url: url))
        }
    }
}

extension JKWebViewController {

    override func setupTableView() {
        
        navItem.title = "网页"
        
        view.insertSubview(webView, belowSubview: navigationBar)
        
        webView.backgroundColor = UIColor.white()
        
        webView.scrollView.contentInset.top = navigationBar.bounds.height
    }
}
